package com.rchik.divermate;

import android.app.Activity;
import android.view.View;

import com.admob.android.ads.AdView;

public class AdvertisingActivity extends Activity {

	private AdView adView;
	private static int adCounter = 0;

	@Override
	protected void onResume() {
		
		super.onResume();
		
		adCounter = (int) Math.round(Math.random());
		if ( adView == null)
		{
			adView = (AdView)findViewById(R.id.ad);
		}
		
		if (adCounter == 1)
		{	
			if (adView != null )
			{
				adView.setAdListener(new DivingMenuAdListener());
				adView.setVisibility(View.VISIBLE);
			}
		}
		else
		{
			adView.setVisibility(View.GONE);
		}
	}
}
